import { get, post, del } from '@/utils/request'

// 创建备份
export const createBackupApi = () => post('/system/backup/create')

// 导入备份
export const importBackupApi = (formData: FormData) =>
  post('/system/backup/import', formData, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })

// 恢复备份
export const restoreBackupApi = (id: number) => post(`/system/backup/${id}/restore`)

// 删除备份
export const deleteBackupApi = (id: number) => del(`/system/backup/${id}`)

// 获取备份列表数据
export const fetchBackupData = (params?: any) => get('/system/backup/list', params) 